--[[
* 能量变更后
*]]
---@class BuffEffect81 : BaseBuffEffect
BuffEffect81 = ClientFight.CreateClass("BuffEffect81", ClientFight.BaseBuffEffect)
local t = BuffEffect81
---@param fight Fight
---@param buff FighterBuff

function t:action(fight, buff, ...)
    local target = buff.target;
    local source = buff.source;
    local buffEffectValue = buff.buffBean.f_BuffEffectValue;
    local addBuffId = 0;
    local buffOverlay = 1;
    for i = 0, table.getn(buffEffectValue), 3 do
        local skillId = buffEffectValue[i];
        local buffId = buffEffectValue[i + 1];
        buffOverlay = buffEffectValue[i + 2];
        if (t:containsSkillId(skillId, source)) then
            addBuffId = buffId;
            break ;
        end
    end
    if (addBuffId == 0) then
        return ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
    end
    ClientFight.BuffManager.addBuff(fight, buff.skill, source, target, false, addBuffId, buffOverlay);
    local addBuffIdLog = addBuffId;
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
            .. buff.modelId .. " 触发添加buff " .. addBuffIdLog);
    return ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
end
function t:containsSkillId(skillId, source)
    local skills = source.skills;
    for k, skill in pairs(skills) do
        if (skill.skillId == skillId) then
            return true;
        end
    end
    local passiveskills = source.passiveskills;
    for k, skill in pairs(passiveskills) do
        if (skill.skillId == skillId) then
            return true;
        end
    end
    return false;
end
t.New()